from flask import Flask, request, jsonify
app = Flask(__name__)

@app.route('/api/login', methods=['POST'])
def login():
    """模拟JT15设备登录协议"""
    data = request.json
    if data['device_id'] == 'JT15-A2' and data['password'] == '123456':
        return jsonify({"code": 200, "token": "fake_token_123"})
    return jsonify({"code": 403, "error": "认证失败"}), 403

if __name__ == '__main__':
    app.run(port=5000, debug=True)